package com.it.you.base.map;

import com.it.you.pojo.Comment;

import java.util.HashMap;
import java.util.Map;

public class HashMapTest2 {
    public static void main(String[] args) {
        Map<Comment, String> map = new HashMap<>();
        Comment comment1 = new Comment(1, "赞");
        Comment comment2 = new Comment(2, "干的漂亮");
        map.put(comment1, "hello");
        map.put(comment2, "world");
        System.out.println(map);
        Integer id = map.keySet().iterator().next().getId();
        System.out.println(id);

    }
}
